import App from './App';
import uviewPlus from '@/uni_modules/uview-plus';
import cityPicker from '@/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/piaoyi-cityPicker';
// #ifndef VUE3
import Vue from 'vue';
import './uni.promisify.adaptor';
import io from './common/weapp.socket.io.js';

Vue.config.productionTip = false;
App.mpType = 'app';

Vue.prototype.socket = io('http://localhost:8000');
const app = new Vue({
	...App,
});
app.config.globalProperties.$socket = socket; // 将 socket 对象挂载到全局
app.$mount();
// #endif

// #ifdef VUE3
import {
	createSSRApp,
} from 'vue';
import {
	createPinia,
} from 'pinia';

import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'; // 导入pinia持久化插件
export function createApp() {
	const pinia = createPinia();
	const app = createSSRApp(App);
	app.use(uviewPlus).use(cityPicker).use(pinia.use(piniaPluginPersistedstate));
	return {
		app,
	};
}
// #endif
